<?
require("config.php");

$label = "Sub Item Edit";

if ($action!=NULL){

   $field = array(
		"pro_code",
		"pro_name",
		"pro_color",
		"pro_size",
		"unit_price",
		"qty",
	);


   $content = array(
		$ProductCode,
		$ProductName,
		$pro_color,
		$pro_size,
		$Price,
		$Qty,
	);

   $exp = "id=$id";

   myUpdate($table1,$field,$content,$exp);


   //header("location:?type=success");

	echo "<script language=javascript>top.close();opener.location.href=opener.self.location</script>";


   exit();

}

require($rela_path . "inc/header1.php");

if ($type==NULL){
$Query = "SELECT 
no,
pro_code,
pro_name,
pro_color,
pro_size,
unit_price,
qty 
FROM $table1 WHERE id=$id";
$r=myQuery($Query);


?>
<form action="" method="post" name="form2">
  <!--hidden filed-->
  <input name="action" type="hidden" value="save">
  <input name="id" type="hidden" value="<?print($id)?>">
  <table border="0" cellspacing="1" cellpadding="3">
    <tr> 
      <td width="40%"><u><b>Sub Item</b></u></td>
      <td width="60%">&nbsp;</td>
    </tr>
    <tr> 
      <td>Product Code :</td>
      <td><?print($r[0][1])?> <input type="hidden" class="text" name="ProductCode" value="<?print($r[0][1])?>"> 
	  
      </td>
    </tr>
    <tr> 
      <td>Product Name :</td>
      <td><?print($r[0][2])?><input type="hidden" class="text" name="ProductName" size="40" value="<?print($r[0][2])?>"> 
      </td>
    </tr>
    <tr> 
      <td>Unit Price : </td>
      <td> <input type="text" class="text" name="Price" value="<?print($r[0][5])?>"> </td>
    </tr>
    <tr> 
      <td>Qty :</td>
      <td> <input type="text" class="text" name="Qty" value="<?print($r[0][6])?>"> </td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td> <input type="submit" class="button" name="Submit3" value="  Save  "> 
      </td>
    </tr>
  </table>
 </form>
<?
}else{
?>


<table border="0" cellspacing="1" cellpadding="3" width=99%>
    <tr> 
      <td align="center"><br><br><br><br><br>This record has been saved!</td>
    </tr>
</table>
<?

}

require($rela_path . "inc/footer1.php");

?>